﻿using ED.BaseServerGRPCInterface;
using ED.IService.Grpc;
using Microsoft.AspNetCore.Mvc;

namespace ED.Admin.Controllers
{
    /// <summary>
    /// 
    /// </summary>
    public class TestController : CommonController
    {
        private readonly IGrpcClientService<IGreeterService> gRPCExtions;

        /// <summary>
        /// 
        /// </summary>
        /// <param name="gRPCExtions"></param>
        public TestController(IGrpcClientService<IGreeterService> gRPCExtions)
        {
            this.gRPCExtions = gRPCExtions;
        }

        /// <summary>
        /// GrpcTest
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public async Task<IActionResult>  GrpcTest()
        {
            var service = await gRPCExtions.GetService("");
            var message = service.SayHelloAsync("ss");
            return Ok(message);
        }
    }
}
